#include "Lemon_NFC.h"
#include "ST25DVSensor.h"
#include <Wire.h>
#include <String.h>

 #define GPO_PIN D1
 #define LPD_PIN D2
 #define SDA_PIN D4
 #define SCL_PIN D3

 TwoWire MyWire;

Lemon_NFC::Lemon_NFC(){
  
}
 void Lemon_NFC::Write_Url(IPAddress ipaddress)
 {
    String uri_write_message;       // Uri message to write in the tag
    uri_write_message = ipaddress.toString();
    const char uri_write_protocol[] = URI_ID_0x03_STRING; // Uri protocol to write in the tag
    String uri_write = String(uri_write_protocol) + uri_write_message;

    MyWire.begin(SDA_PIN, SCL_PIN);
    // The wire instance used can be omited in case you use default Wire instance
    if (st25dv.begin(GPO_PIN, LPD_PIN, &MyWire) == 0)
    {
        Serial.println("System Init done!");
    }
    else
    {
        Serial.println("System Init failed!");
        while (1);
    }

    if (st25dv.writeURI(uri_write_protocol, uri_write_message, ""))
    {
        Serial.println("Write failed!");
    }
 }